home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Views / Panes / RectangularPane.h < prev    next >
Text File  |  2000-06-23  |  1KB  |  58 lines

  1. // RectangularPane.h
  2.  
  3. #ifndef RectangularPane_h
  4. #define RectangularPane_h
  5.  
  6. #ifndef Pane_h
  7. #include "Pane.h"
  8. #endif
  9. #ifndef Rectangle32_h
  10. #include "Rectangle32.h"
  11. #endif
  12. #ifndef Announcing_h
  13. #include "Announcing.h"
  14. #endif
  15. #ifndef AcceptsSizeSuggestions_h
  16. #include "AcceptsSizeSuggestions.h"
  17. #endif
  18. #ifndef AcceptsConformanceToSize_h
  19. #include "AcceptsConformanceToSize.h"
  20. #endif
  21.  
  22. class RectangularPane: public Pane,
  23.                               public AcceptsSizeSuggestions,
  24.                               public AcceptsConformanceToSize
  25.   {
  26.     private:
  27.         Rectangle32 bounds;
  28.         
  29.     public:
  30.         explicit RectangularPane( const DrawsSpontaneously *parent = 0 );
  31.  
  32.         virtual inline void SetContent( View& );
  33.         void Clear();
  34.  
  35.         virtual void Adjust( Canvas& ) const;
  36.         
  37.         const Rectangle32& Bounds() const            { return bounds; }
  38.         void SetBounds( Rectangle32 );
  39.  
  40.         void Deliver( CellVisitor& visitor,
  41.                           const Canvas& parentCanvas,
  42.                           Canvas& scratchCanvas,
  43.                           const Rectangle32& destination ) const
  44.           {
  45.             if ( destination.Intersects( bounds ) )
  46.                 Pane::Deliver( visitor, parentCanvas, scratchCanvas );
  47.           }
  48.   };
  49.  
  50. inline void RectangularPane::SetContent( View& view )
  51.   {
  52.     AcceptsSizeSuggestions::SetContent( view );
  53.     Pane::SetContent( view );
  54.     AcceptsConformanceToSize::SetContent( view );
  55.   }
  56.  
  57. #endif
  58.